package day20180405;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class TestReadPOI07 {

    public void readExcel07() throws IOException {

        FileInputStream inputStream =new FileInputStream(new File("F:\\poi.xlsx"));
        //读取工作簿
        XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
        //读取工作表
        XSSFSheet sheet = workbook.getSheetAt(0);
        //读取行
        XSSFRow row = sheet.getRow(2);
        //读取单元格
        XSSFCell cell = row.getCell(2);
        String value = cell.getStringCellValue();

        System.out.println(value);

        inputStream.close();
        workbook.close();

    }

}
